package com.yueyang.sojourn.server.service.member;

import com.yueyang.sojourn.server.model.po.User;

import java.util.Date;
import java.util.List;

import com.yueyang.sojourn.server.model.vo.SojournUserVo;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Long userId);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Long userId);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    void batchInsert(@Param("userList") List<User> userList);

    User selectNewest();

    /**
     * 会员列表页搜素
     * @param keyword
     * @param regTimeStart
     * @param regTimeEnd
     * @param member
     * @param sexValues
     * @return
     */
    List<SojournUserVo> findCustList(@Param("keyword") String keyword,
                                     @Param("regTimeStart") Date regTimeStart,
                                     @Param("regTimeEnd") Date regTimeEnd,
                                     @Param("member") Boolean member,
                                     @Param("sexValues") List<Byte> sexValues);

    /**
     * 统计所有的客户数量
     * @return
     */
    Long countCustAll();
}